package com.wausinterest;

import java.util.ArrayList;
import java.util.List;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.ArrayAdapter;

import com.wausinterest.R;
import com.wausinterest.util.Model;

public class MainActivity extends ListActivity {
	private List<Model> list;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		list = getModel();
		ArrayAdapter<Model> adapter = new InteractiveArrayAdapter(
				getApplicationContext(), list);
		setListAdapter(adapter);
	}

	private List<Model> getModel() {
		list = new ArrayList<Model>();
		for (int i = 0; i < 20; i++) {
			Model model = new Model("strTitle" + i, "strContent" + i,
					"strUrlContext" + i, "strUrlImage" + i);
			list.add(model);
		}
		return list;
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
}